package com.kly.user.rulePolicy.enums;

/**
 * 决策结果：1:拒绝 2:通过
 * @author linqu
 */
public enum DecisionResultEnum {

    PASS(1, "Pass"),
    REJECT(2, "Reject"),
    UNKNOWN(3, "Unknown")

    ;

    private final int type;

    private final String Value;


    DecisionResultEnum(int type, String value) {
        this.type = type;
        Value = value;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public static DecisionResultEnum fromType(int type) {
        for (DecisionResultEnum userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        throw new IllegalArgumentException("Invalid type: " + type);
    }
}
